package com.smt.modules.app.controller;

import com.smt.modules.bus.service.ZxingCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;

/**
 * 生成验证码
 *
 * @author zhangyi
 * @date 2018/11/15 11:44
 */
@Controller
@RequestMapping("/app/zxing")
public class ZxingCodeController {

    @Autowired
    private ZxingCodeService zxingCodeService;

    @PostMapping("/getCodeImg")
    public void getCodeImg(@RequestParam("filePath")String filePath, HttpServletResponse response){
        //应该是返回图片流
        zxingCodeService.getUrlImg(response, filePath);
    }
}
